This invention relates to a distributed database constructed on a plurality of computers.
In recent years, the amount of data has increased explosively in computer system for executing an application using the Web; there are known various systems for enhancing performance of data access by distributing the data to a plurality of servers. For example, there is known a Not only SQL (NoSQL) database, such as key-value store (KVS).
The KVS can adopt various configurations. For example, there are known a configuration (memory store) in which data is stored in a volatile storage medium capable of accessing data at high speed, such as a memory, a configuration (disk store) in which data is stored in a non-volatile storage medium that is superior in durability of data storage, such as a solid state disk (SSD) or an HDD, and a configuration in which the above-mentioned configurations are used in combination.
The memory store and the disk store hold a plurality of records each including data (a value) paired with identification information (a key) of the data.
An in-memory distributed KVS is a KVS constructed on the memories of a plurality of servers configured as a cluster. Such a configuration enables high speed data access and high system availability.
Each server constructing the distributed KVS stores data of a predetermined management range (e.g., a key range). Further, to ensure the reliability of the data in the distributed KVS, each server stores replicated data of the data included in the management range managed by another server.
Each server executes processing as a master server of the data included in the management range. In other words, in response to a read request including a key, the server managing the management range including the data associated with that key reads the data associated with the key. Further, each server operates as a slave server of replicated data of the management range managed by another server.
In the following description, the data to be managed by the master server is also referred to as master data, and the data to be managed by the slave server is also referred to as slave data.
Therefore, in the distributed KVS, even when a failure occurs in one server, another server holding replicated data of the master data of that server can continue processing as a new master server.
For transaction processing using a database such as the distributed KVS, it is important to guarantee the data integrity, i.e. the consistency in data after executing the transaction processing.
When a failure such as a network error occurs, the distributed KVS system regards the failure as a failure in a master server and changes its slave server into a new master server. As a result, two master servers coexist in the system and the two master servers may execute transaction processing onto the same master data. In such a case, the consistency is not guaranteed.
U.S. Pat. No. 6,772,363 discloses aborting all transaction processing (for example, see FIG. 3) when a failure occurs in a primary data server that is processing a transaction.